<template>
    <div>
        {{parmse}}
    </div>
</template>

<script>
    import axios from "axios";
    export default {
        name: "w",
        data(){
            return{
                url:"",
                parmse:""
            }
        },
        created() {
            this.url = location.host.split(':')[0] == 'localhost' ? 'https://dev.hahaipi.com/smsti/index.php' : `https://${location.host}/smsti/index.php`,
            this.linkPage();
        },
        methods:{
            linkPage(){
                this.parmse = this.$route.params._id; //为动态参数
                let config = {
                    headers: {
                        'Content-Type': 'multipart/form-data'
                    }
                };
                let data = new FormData();
                data.append('short_connection', this.parmse);
                axios
                    .post(this.url+'/Sendsms/get_long_connection',data,config)
                    .then(res => {
                        console.log(res);
                        if(res.data){
                            window.location.replace(res.data.long_connection);
                        }else{
                            this.$message.error(res.data.message);
                        }
                    });
            }
        }
    }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>

</style>